#include <iostream>
#include <vector>

bool YorN(int target)
{
    while (target)
    {
        if (target >= 10 && (target / 10) % 10 != target % 10)
            return false;
        if (target % 10 == target)
            return true;
        target /= 10;
    }
    return true;
}

int solution(int x, int y) {
    // Edit your code here
    int count = 0;
    for (; x <= y; x++)
    {
        if (YorN(x))
            count++;
    }
    return count;
}

int main() {
    // Add your test cases here

    std::cout << (solution(1, 10) == 9) << std::endl;
    std::cout << (solution(2, 22) == 10) << std::endl;

    return 0;
}